package main

import (
	"net/http"
	controller "todolist-go/src/Controller"
	service "todolist-go/src/Service"
)

func main() {
	//若写在service中会出现一个方法调用完了之后其它方法调用数据库时失败
	defer service.Db.Close()
	defer service.Rd.Close()
	http.HandleFunc("/post/register", controller.Register)
	http.HandleFunc("/post/login", controller.Login)
	http.HandleFunc("/get/currentUser", controller.CurrentUser)
	http.ListenAndServe(":9000", nil)
}
